import java.util.Scanner;

public class Test {

	public static void main(String[] args) {
		int n = new Scanner(System.in).nextInt();
		int k = 1;
		while (true) {
			int t = (int) Math.pow(n, k);
			System.out.println(t + " " + k);
			if (String.valueOf(t).length() == k) {
				k++;
			} else// if (String.valueOf(t).length() != k)
				break;
		}
		System.out.println(--k);
	}

}
